<html>
<head><meta charset="utf-8"><title>debruijn indices and bound variables chalk#334 · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html">debruijn indices and bound variables chalk#334</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="189969176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/189969176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#189969176">(Mar 07 2020 at 12:33)</a>:</h4>
<p>So I put in some time this morning working on changing chalk's debruijn system to count binders and not variables (<a href="https://github.com/rust-lang-nursery/chalk/issues/334" target="_blank" title="https://github.com/rust-lang-nursery/chalk/issues/334">chalk#334</a>). The motivation here is to make chalk match rustc more closely. However, I realized part-way through that I'm not sure (a) it will achieve that goal and (b) what we should really be shooting for.</p>
<p>I started writing up some notes. So far I wrote up some short description of how chalk/rustc works:</p>
<p><a href="https://gist.github.com/fe440aec437f7e8ad4cce8319954a973" target="_blank" title="https://gist.github.com/fe440aec437f7e8ad4cce8319954a973">https://gist.github.com/fe440aec437f7e8ad4cce8319954a973</a></p>
<p>I didn't get as far yet as some of the downsides to adopting the model I was trying to adopt, I'll try to add more notes on that at some point. But maybe what's there is already of interest (and/or people have questions, since I imagine it could be quite confusing). </p>
<p>This is also related to the questions that <span class="user-mention" data-user-id="232957">@Jack Huey</span> and <span class="user-mention" data-user-id="129457">@Florian Diebold</span> were raising about how to represent parameters (or how to translate from rustc's representation of parameters). </p>
<p>It seems worth taking a step back to think about <em>what representation we want</em> a bit more and then maybe adapting both rustc/chalk accordingly (particularly in light of the design meeting from Friday).</p>



<a name="189971525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/189971525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#189971525">(Mar 07 2020 at 13:57)</a>:</h4>
<blockquote>
<p>Here, the type (Self, T, U) would be (^0, ^1, ^2). This is because the trait effectively has a binder for&lt;Self, T&gt; and then the Bar further introduces a binder for&lt;U&gt; (nested within).</p>
</blockquote>
<p>shouldn't it be <code>(^1, ^2, ^0)</code>?</p>



<a name="189987027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/189987027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#189987027">(Mar 07 2020 at 21:31)</a>:</h4>
<p><span class="user-mention silent" data-user-id="129457">Florian Diebold</span> <a href="#narrow/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334/near/189971525" title="#narrow/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334/near/189971525">said</a>:</p>
<blockquote>
<blockquote>
<p>Here, the type (Self, T, U) would be (^0, ^1, ^2). This is because the trait effectively has a binder for&lt;Self, T&gt; and then the Bar further introduces a binder for&lt;U&gt; (nested within).</p>
</blockquote>
<p>shouldn't it be <code>(^1, ^2, ^0)</code>?</p>
</blockquote>
<p>Or <code>(^2, ^1, ^0)</code> if <code>'a</code> is innermost right to left?</p>



<a name="189987082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/189987082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#189987082">(Mar 07 2020 at 21:32)</a>:</h4>
<p>err nvm</p>



<a name="189987094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/189987094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#189987094">(Mar 07 2020 at 21:33)</a>:</h4>
<p>nvm, I'm confused</p>



<a name="189987139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/189987139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#189987139">(Mar 07 2020 at 21:34)</a>:</h4>
<p>Would this essentially be <code>for&lt;Self, T&gt; for&lt;U&gt;  (Self, T, U)</code></p>



<a name="189987159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/189987159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#189987159">(Mar 07 2020 at 21:35)</a>:</h4>
<p>Which gets indexed as <code>for&lt;^1,^2&gt; for&lt;^0&gt; (^1, ^2, ^0)</code></p>



<a name="189987207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/189987207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#189987207">(Mar 07 2020 at 21:36)</a>:</h4>
<p>So yeah, what <span class="user-mention" data-user-id="129457">@Florian Diebold</span> said</p>



<a name="190077547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/190077547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#190077547">(Mar 09 2020 at 14:57)</a>:</h4>
<p><span class="user-mention silent" data-user-id="129457">Florian Diebold</span> <a href="#narrow/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334/near/189971525" title="#narrow/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334/near/189971525">said</a>:</p>
<blockquote>
<blockquote>
<p>Here, the type (Self, T, U) would be (^0, ^1, ^2). This is because the trait effectively has a binder for&lt;Self, T&gt; and then the Bar further introduces a binder for&lt;U&gt; (nested within).</p>
</blockquote>
<p>shouldn't it be <code>(^1, ^2, ^0)</code>?</p>
</blockquote>
<p>Sigh. Yes!</p>



<a name="190077562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/190077562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#190077562">(Mar 09 2020 at 14:57)</a>:</h4>
<p>Thanks.</p>



<a name="191534459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191534459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191534459">(Mar 23 2020 at 20:50)</a>:</h4>
<p>OK, I guess I'm going to use this topic to keep discussion alive on how to represent debruijn indices and the like in chalk.</p>



<a name="191534477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191534477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191534477">(Mar 23 2020 at 20:50)</a>:</h4>
<p>I was reading a bit more into the code and realized that some of the comments are wrong</p>



<a name="191534514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191534514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191534514">(Mar 23 2020 at 20:51)</a>:</h4>
<p>In particular, in the existing chalk-rust-ir types, afaict we only have one level of binders at the outermost level</p>



<a name="191534590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191534590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191534590">(Mar 23 2020 at 20:51)</a>:</h4>
<p>In particular, <code>AssociatedTyValue</code> and <code>AssociatedTyDatum</code> contain <code>Binders&lt;...&gt;</code> values, and those binders include <em>both</em> the parameters from the outer impl <em>and</em> the parameters from the associated type</p>



<a name="191534671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191534671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191534671">(Mar 23 2020 at 20:52)</a>:</h4>
<p>For some reason, I thought that this was not the case (perhaps because the comments say as much)</p>



<a name="191534680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191534680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191534680">(Mar 23 2020 at 20:52)</a>:</h4>
<p>but the comments are wrong</p>



<a name="191534733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191534733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191534733">(Mar 23 2020 at 20:52)</a>:</h4>
<p>This is good</p>



<a name="191535020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191535020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191535020">(Mar 23 2020 at 20:54)</a>:</h4>
<p>The <em>order</em> of those parameters is different from rustc, but having a single binder level may mean that we can adopt the "count binder levels, not bindings" model without ever needing to apply more than one level of binder at once.</p>



<a name="191536047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191536047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191536047">(Mar 23 2020 at 21:02)</a>:</h4>
<p>it would also be easy enough to change the order</p>



<a name="191537155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191537155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191537155">(Mar 23 2020 at 21:11)</a>:</h4>
<p>What comments in particular?</p>



<a name="191539329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191539329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191539329">(Mar 23 2020 at 21:30)</a>:</h4>
<p>so <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-rust-ir/src/lib.rs#L310-L315" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-rust-ir/src/lib.rs#L310-L315">this comment</a> is correct, <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-rust-ir/src/lib.rs#L406-L415" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-rust-ir/src/lib.rs#L406-L415">but this one</a> is wrong</p>



<a name="191636362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191636362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191636362">(Mar 24 2020 at 16:26)</a>:</h4>
<p>As an update: I pushed more on my debruijn branch. I'm working on getting the tests to pass using the approach I was using, and just saying that we have only one binding level for things like associated types (which combines the variables from the two binders into one). </p>
<p>Once this is done there will remain two things to reconcile vis a vis how rustc does things:</p>
<ul>
<li>for each binders, chalk has a list of kinds, whereas rustc assumes lifetimes (this should be changed in rustc)</li>
<li>we are using indices for bound variables, rustc uses names (if we change the above, I think then that rustc should be refactored here too, though it may want to include the name/def-id <em>too</em> for debug output, as we do for "early bound" things today)</li>
</ul>
<p>I think that the latter in particular will have to be reconciled on the rustc side to make chalk integration possible in the way I was originally envisioning. However, we could do a "quick-n-dirty" chalk integration today without making <em>any</em> of these changes, but I'll cover that a bit in the <a class="stream-topic" data-stream-id="144729" href="/#narrow/stream/144729-wg-traits/topic/reintegrating.20chalk.20into.20rustc">#wg-traits &gt; reintegrating chalk into rustc</a> topic.</p>



<a name="191736124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191736124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191736124">(Mar 25 2020 at 12:22)</a>:</h4>
<p>After putting some more time in this morning before the household woke up, I've got my debruijn branch building now and passing tests.</p>



<a name="191736137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/191736137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#191736137">(Mar 25 2020 at 12:22)</a>:</h4>
<p>/me -&gt; breakfast time</p>



<a name="192056113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192056113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192056113">(Mar 27 2020 at 17:56)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="232957">@Jack Huey</span> -- so I should probably go do the other things I meant to do today, but I keep being tempted to try and make this PR more beautiful. Anyway I was playing about with the <code>DebruijnIndex</code> APIs, trying to rejigger the code so that most things which talk about binding levels do so via <code>DebruijnIndex</code> values, and not via raw integers.</p>



<a name="192056534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192056534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192056534">(Mar 27 2020 at 17:59)</a>:</h4>
<p>So <span class="user-mention" data-user-id="116009">@nikomatsakis</span> , see my new comments. But overall, I would say that there's only a couple things that definitely should be fixed <em>in this PR</em></p>



<a name="192056610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192056610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192056610">(Mar 27 2020 at 17:59)</a>:</h4>
<p>I think changing code to use <code>DebruijnIndex</code> instead of raw integers can be left for a followup PR</p>



<a name="192056708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192056708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192056708">(Mar 27 2020 at 18:00)</a>:</h4>
<p>Because this should help a lot with rustc integration, and I would rather get it in sooner rather than later</p>



<a name="192056814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192056814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192056814">(Mar 27 2020 at 18:01)</a>:</h4>
<p>Also, can you file followup issues about the implied bounds problem?</p>



<a name="192056865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192056865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192056865">(Mar 27 2020 at 18:01)</a>:</h4>
<p>If you have some time later today, we should block out some time and get the blog post finished</p>



<a name="192056887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192056887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192056887">(Mar 27 2020 at 18:01)</a>:</h4>
<p>I'm gonna try to finish writing it soon and you can edit</p>



<a name="192058088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192058088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192058088">(Mar 27 2020 at 18:10)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334/near/192056865" title="#narrow/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334/near/192056865">said</a>:</p>
<blockquote>
<p>If you have some time later today, we should block out some time and get the blog post finished</p>
</blockquote>
<p>yeah this was one of the things I wanted to do today</p>



<a name="192058100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192058100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192058100">(Mar 27 2020 at 18:11)</a>:</h4>
<p>ok I'm going to force myself to stop this branch for a second :)</p>



<a name="192059423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192059423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192059423">(Mar 27 2020 at 18:20)</a>:</h4>
<p>What time is good for you?</p>



<a name="192061149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192061149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192061149">(Mar 27 2020 at 18:33)</a>:</h4>
<p>ok I lied, I couldn't stop until that damn thing was building. Just pushed those commits.</p>



<a name="192061206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192061206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192061206">(Mar 27 2020 at 18:34)</a>:</h4>
<p>I didn't try to remove the as-u32 and as-usize business but I think the rest worked out quite well.</p>



<a name="192061239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192061239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192061239">(Mar 27 2020 at 18:34)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> I have a call at 3 for a bit, but I am going to go poke at the blog post now</p>



<a name="192062180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062180">(Mar 27 2020 at 18:41)</a>:</h4>
<p>Ok, I'll review/merge later</p>



<a name="192062197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062197">(Mar 27 2020 at 18:41)</a>:</h4>
<p>there's probably some out of date docs</p>



<a name="192062207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062207">(Mar 27 2020 at 18:41)</a>:</h4>
<p>though I tried to do a good job with the doc comments</p>



<a name="192062298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062298">(Mar 27 2020 at 18:42)</a>:</h4>
<p>Test failed :(</p>



<a name="192062329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062329">(Mar 27 2020 at 18:42)</a>:</h4>
<p>/me tests locally</p>



<a name="192062331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062331">(Mar 27 2020 at 18:42)</a>:</h4>
<p>I thought they were passing</p>



<a name="192062416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062416">(Mar 27 2020 at 18:43)</a>:</h4>
<p>doc comment test</p>



<a name="192062445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062445">(Mar 27 2020 at 18:43)</a>:</h4>
<p>src/lib.rs:445:8<br>
  |<br>
3 | for&lt;A&gt; for&lt;B&gt; for&lt;C&gt; for&lt;D&gt;<br>
  |        ^^^ expected one of <code>async</code>, <code>move</code>, <code>static</code>, <code>|</code>, or <code>||</code></p>



<a name="192062548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062548">(Mar 27 2020 at 18:43)</a>:</h4>
<p>yeah</p>



<a name="192062560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062560">(Mar 27 2020 at 18:43)</a>:</h4>
<p>I figured it'd be something like that</p>



<a name="192062567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062567">(Mar 27 2020 at 18:44)</a>:</h4>
<p>just a missing ignore</p>



<a name="192062609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/debruijn%20indices%20and%20bound%20variables%20chalk%23334/near/192062609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/debruijn.20indices.20and.20bound.20variables.20chalk.23334.html#192062609">(Mar 27 2020 at 18:44)</a>:</h4>
<p>pushed a fix</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>